<!doctype html>
<html>
 <head> 
  <meta charset="utf-8"> 
  <title>sliderTime 时间范围滑块选择 sliderTime - layui 第三方组件平台</title> 
  <meta name="renderer" content="webkit"> 
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> 
  <meta name="description" content="基于 layui.slider 扩展的时间范围选择插件
"> 
  <link rel="stylesheet" href="/t/font_24081_60slu02pimt.css">
  <link rel="stylesheet" href="/layui/dist/css/layui.css">
  <link rel="stylesheet" href="/static/css/fly/global.css" charset="utf-8">
  <link rel="stylesheet" href="/static/css/global.css" charset="utf-8">
  <link rel="stylesheet" href="/static/css/global.css" charset="utf-8">
 </head>
 <body>
  <div class="layui-header header header-extends" style="background-color: #24262F;"> 
   <div class="layui-container"> <a class="logo" href="/"> <img src="/static/images/layui/logo.png" alt="layui"> </a>
    <div class="layui-form component" lay-filter="LAY-site-header-component"></div> 
    <ul class="layui-nav"> 
     <li class="layui-nav-item layui-hide-xs"> <a href="/">框架</a> </li>
     <li class="layui-nav-item layui-hide-xs layui-this"> <a href="/extend/index.html">扩展</a> </li> 
     <li class="layui-nav-item"> <a href="javascript:;">周边</a> 
      <dl class="layui-nav-child layui-nav-child-c"> 
       <dd lay-unselect> <a href="/alone.html" target="_blank">独立组件</a>
       </dd> 
       <dd class="layui-hide-sm layui-show-xs" lay-unselect> <a href="/extend/index.html">扩展组件</a> 
        <hr> 
       </dd> 
      </dl> </li> 
    </ul> 
   </div>
  </div><!--[if lt IE 9]>  <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>  <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script><![endif]--> 
  <div class="fly-extend-banner fly-extend-banner-sm"> 
   <div class="layui-carousel" id="FLY-extend-banner" data-height="200px"> 
    <div carousel-item> 
     <div style="background-image: url(/upload/2018_8/168_1535373858670_8825.jpg)">
      <div style="background: rgba(0,0,0,.6)"></div> 
     </div> 
    </div> 
   </div> 
   <h1 class="fly-extend-banner-title">layui 第三方组件平台</h1> 
   <div class="fly-extend-banner-release"> <a href="/extend/index.html" class="layui-btn layui-btn-lg">返回首页</a>
   </div> 
  </div>
  <div class="fly-extend-detail layui-card"> 
   <div class="layui-container"> 
    <div class="fly-extend-list-header"> 
     <h1 class="fly-extend-title layui-elip"> <a>sliderTime 时间范围滑块选择</a> <span class="layui-badge layui-bg-green layui-hide-xs">sliderTime</span> </h1> 
     <div class="fly-extend-list-info"> <a href="/u/15125712/index.html" target="_blank" class="fly-extend-list-user" title="发布者"> <cite class="layui-hide-xs">mo**3</cite> <img src="/qqapp/101235792/93B3F10485F0F10D1ED0F189190225D0/100" alt="mo**3"> </a> 
     </div> 
    </div> 
    <blockquote class="fly-extend-list-desc layui-elem-quote"> 
     <p>基于 layui.slider 扩展的时间范围选择插件 </p> 
    </blockquote> 
    <div class="fly-extend-list-bottom"> <span class="layui-inline">更新：2021-5-8 </span> <span class="layui-inline">创建：2021-5-2 </span> 
     <div class="layui-btn-container layui-extend-doc-edit"> 
     </div> 
    </div> 
   </div>
  </div>
  <div class="layui-container"> 
   <div class="layui-row layui-col-space20"> 
    <div class="layui-col-sm3 layui-col-md2"> 
     <div class="layui-card"> 
      <ul class="fly-extend-doc-nav" lay-filter="extend-doc-nav"> 
       <li class="layui-this" lay-id="doc"> <a href="javascript:;"><i class="iconfont icon-wendang"></i> 文档</a> </li> 
       <li lay-id="download"> <a href="javascript:;"><i class="iconfont icon-xiazai"></i> 下载</a> </li> 
       <li lay-id=""> <a href="https://gitee.com/momo5013/slider-time" rel="nofollow" target="_blank"> <i class="iconfont icon-kaifashili"></i> 来源 </a> </li> 
      </ul> 
     </div> 
    </div> 
    <div class="layui-col-sm9 layui-col-md10"> 
     <div class="layui-card fly-extend-doc layui-show"> 
      <div class="layui-card-header"> 
       <h3 class="layui-inline layui-this">文档</h3> 
      </div> 
      <div class="layui-card-body detail-body photos layui-text"> 
       <img src="/image/blog/20210420163045.png"> 
       <br>
       <br>
       <div class="layui-elem-quote">
         Demo
       </div> <a href="https://www.itmm.wang/module/demo/sliderTime.html" target="_blank" rel="nofollow">SliderTime 时间范围滑块选择</a> 
       <br>
       <br>
       <div class="layui-elem-quote">
         示例
       </div>
       <pre>layui.config({<br>    base: ...<br>}).extend({<br>    sliderTime: "sliderTime/sliderTime"<br>});<br><br>layui.use(['sliderTime'], function () {<br>    var sliderTime = layui.sliderTime;<br><br>    var slider = sliderTime.render({<br>          elem: '#id'  //绑定元素<br>        , min: sliderTime.timeToNum("8:00")<br>        , max: sliderTime.timeToNum("18:00")<br>        , step: 10<br>        , disabledValue: [["10:00", "10:30"], ["14:00", "15:30"]] // 回显禁止选择时间段<br>        , disabledText: '{start} ~ {end} 已占用'<br>        , setTips: function (value) {<br>            //自定义提示文本<br>            return sliderTime.numToTime(value);<br>        }, change: function (value) {<br>            console.log(value[0] + "-" + value[1])<br>        }<br>    });<br>});</pre>
       <div class="layui-elem-quote">
         使用说明
       </div>1.sliderTime 基于 layui.slider，所以 slider 的配置都得以保留
       <br>2.range 参数强制为 true
       <br>3.新增 disabledValue 属性，禁止选择时间范围。例如：[["10:00", "10:30"], ["14:00", "15:30"]]
       <br>4.新增 disabledText 属性，禁止选择时间范围被选中后的提示内容，不配置不显示提示。例如：'{start} - {end} 已占用'，支持start和end时间占位符
       <br>5.新增 getValue 方法，返回当前选择的时间段（时间格式）
       <br>6.新增 isOccupation 方法，返回当前选择的时间段是否包含了禁止选择的时间段
       <br>7.新增 numToTime 公用方法，用于将十进制转为时间格式。例如：480 → 08:00
       <br>8.新增 timeToNum 公用方法，用于将时间格式转为十进制。例如：24:00 → 1440 
      </div> 
     </div> 
     <div class="layui-card fly-extend-doc"> 
      <div class="layui-card-header"> 
       <h3 class="layui-inline layui-this">下载</h3> 
      </div> 
      <div class="layui-card-body detail-body layui-text"> 
       <div class="layui-btn-container"> <a href="https://gitee.com/momo5013/slider-time" target="_blank" class="layui-btn layui-btn-lg layui-btn-primary layui-border-red"> 去码云下载 </a> 
        <blockquote class="layui-elem-quote">
          该扩展组件由第三方用户主动投递，并由其自身进行维护，本站仅做收集。 
        </blockquote> 
       </div> 
      </div> 
     </div> 
    </div> 
   </div>
  </div>
  <div class="fly-footer"> 
   <p>Copyright © 2021 <a href="/index.html">layui.itmtr.cn</a> MIT Licensed</p>
  </div>
  <script src="/layui/dist/layui.js"></script>
  <script>// common</script>

 </body>
<script src="/common/common.js"></script>
</html>